#!/usr/bin/env bash
if [ "$1" = 'run' ]; then
    echo "[WSGI][RUN]: server"
    exec gunicorn -c gunicorn.py wsgi & exec celery -A celery_app worker -l info
elif [ "$1" = 'asgi' ]; then
    echo "[ASGI][RUN]: server"
    exec gunicorn -c gunicorn.py asgi:application
elif [ "$1" = 'celery' ]; then
    echo "[RUN]: celery"
    exec celery -A celery_app worker -l info
elif [ "$1" = 'beat' ]; then
    echo "[RUN]: celery beat"
    exec celery -A celery_app beat -l info
elif [ "$1" = 'shell' ]; then
    echo "[RUN]: Install"
    bash
else
    echo "[RUN]: $@"
    exec "$@"
fi